import time
import datetime
from python_baway.common.xcommon import sep

sep('my birth day, struct_time, from user')
xmy_birth_st = time.struct_time((1983, 1, 30, 4, 10, 11, 0, 1, -1))
print(time.asctime(xmy_birth_st))

sep('to: timestamp')
xmy_birth_ts = time.mktime(xmy_birth_st)
print(time.ctime(xmy_birth_ts))

sep('my birth day, dt, from user')
xmy_birth_dt = datetime.datetime(1983, 1, 30, 4, 10, 11)
print(f'xmy_birth_dt=>ts == xmy_birth_ts: {xmy_birth_dt.timestamp() == xmy_birth_ts}')
xmy_birht_dt2 = datetime.datetime.fromtimestamp(xmy_birth_ts)
print(xmy_birht_dt2.isoformat())
